fix: remove double path resolution in SSH readLines - #3
Conversation
readLines was pre-resolving the path with this._resolvePath() before passing it to this.readText(), which already calls _resolvePath() internally. This made readLines the only method in SSHKaos that double-resolves the path, inconsistent with readBytes, writeBytes, writeText, mkdir, stat, iterdir, and glob. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
Thank you for your interest in contributing to kimi-code. |
…imeout (Chain 11)
Protocol:
- FsSearchHit / FsGrepMatch / FsGrepFileHit / FsGitStatusEntry entity schemas
- fsSearchRequestSchema / fsSearchResponseSchema (REST.md §3.9 line 575-602)
- fsGrepRequestSchema / fsGrepResponseSchema (REST.md §3.9 line 606-643)
- 33 new protocol tests (was 286 → now 319)
Daemon:
- IFsSearchService decorator + FsSearchServiceImpl (services/fs-search.ts)
- Cached rg detection via PATH walk (no spawn-which); warn-once via ILogger
- rg path uses --json + --no-require-git (so .gitignore respected outside
git repos); strips leading "./" from rg-emitted paths
- Pure-Node fallback walks gitignore-allowed files + per-line regex
- 30s wall-clock timeout via AbortController; rg path SIGKILLs child,
Node path breaks the loop; raises FsGrepTimeoutError → 41305
- 500-hit cap for :search → truncated: true (ROADMAP Chain 11 AC #3)
- routes/fs.ts adds :search / :grep to the tail-split dispatcher; reuses
the W10 fs:<action> routing pattern
- start.ts wires IFsSearchService after IFsService (dispose-first ordering)
- dispose-order test extends to 17-service chain + new IFsSearchService
invariant (disposes before IFsService AND before ISessionService)
- 15 new e2e tests + direct service tests for rg-missing fallback and the
timeout path (daemon was 176 → now 192)
Anti-corruption: 0 SDK imports added.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…imeout (Chain 11)
Protocol:
- FsSearchHit / FsGrepMatch / FsGrepFileHit / FsGitStatusEntry entity schemas
- fsSearchRequestSchema / fsSearchResponseSchema (REST.md §3.9 line 575-602)
- fsGrepRequestSchema / fsGrepResponseSchema (REST.md §3.9 line 606-643)
- 33 new protocol tests (was 286 → now 319)
Daemon:
- IFsSearchService decorator + FsSearchServiceImpl (services/fs-search.ts)
- Cached rg detection via PATH walk (no spawn-which); warn-once via ILogger
- rg path uses --json + --no-require-git (so .gitignore respected outside
git repos); strips leading "./" from rg-emitted paths
- Pure-Node fallback walks gitignore-allowed files + per-line regex
- 30s wall-clock timeout via AbortController; rg path SIGKILLs child,
Node path breaks the loop; raises FsGrepTimeoutError → 41305
- 500-hit cap for :search → truncated: true (ROADMAP Chain 11 AC #3)
- routes/fs.ts adds :search / :grep to the tail-split dispatcher; reuses
the W10 fs:<action> routing pattern
- start.ts wires IFsSearchService after IFsService (dispose-first ordering)
- dispose-order test extends to 17-service chain + new IFsSearchService
invariant (disposes before IFsService AND before ISessionService)
- 15 new e2e tests + direct service tests for rg-missing fallback and the
timeout path (daemon was 176 → now 192)
Anti-corruption: 0 SDK imports added.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
VSCode-style static-first / services-last reorder for the daemon's
most complex ctor. Before (`ws-gateway.ts:94-100`):
constructor(
private readonly restGateway: IRestGateway,
private readonly registry: IConnectionRegistry,
private readonly sessionClients: ISessionClientsService,
private readonly eventBus: DaemonEventBus,
private readonly logger: ILogger,
private readonly options: WSGatewayOptions = {},
)
After:
constructor(
private readonly eventBus: DaemonEventBus,
private readonly options: WSGatewayOptions,
@IRestGateway private readonly restGateway: IRestGateway,
@IConnectionRegistry private readonly registry: IConnectionRegistry,
@ISessionClientsService private readonly sessionClients: ISessionClientsService,
@ILogger private readonly logger: ILogger,
)
Four service deps now auto-inject; only two static prefix args remain.
* `eventBus: DaemonEventBus` stays a concrete-typed static dep because
the WsConnection consumer needs the daemon-specific
`BufferReplaySource` shape (`getBufferedSince`, `currentSeq`,
`addObserver`) which `IEventBus` from `@moonshot-ai/services` does
NOT expose. Promoting `DaemonEventBus` to its own identifier is a
deliberate followup per ROADMAP P2.3 note + phase-1 reviewer handoff
#3.
* `options` lost its inline default — TS forbids a required param after
an optional one, and we need `options` to follow `eventBus` for
static-prefix ordering. start.ts already passes
`opts.wsGatewayOptions ?? {}` so the call site is unchanged.
* start.ts: the 7-line wire-up
`ix.createInstance(WSGateway, a.get(IRestGateway), a.get(IConnectionRegistry),
a.get(ISessionClientsService), eventBus, a.get(ILogger), opts.wsGatewayOptions ?? {})`
collapses to
`ix.createInstance(WSGateway, eventBus, opts.wsGatewayOptions ?? {})`.
agent-core/src/di/ untouched (sealed for Phase 2). Daemon build + test
green (241 pass; WS handshake / ping / event-broadcast / subscribe /
resync e2e all clean).
VERDICT: PASS — ws-gateway.ts:103 4 services decorated + start.ts:323 2-arg createInstance; 241/241 daemon tests green.
|
计划阶段调查结论(2026-06-17 +08:00): 需求确认:
代码定位:
实施计划:
验证计划:
|
|
Implemented the SSH path-resolution fix for #3. Changed:
Verification:
Remaining risk:
|
|
Workmonitor issue-flow plan stage 20260617-111303 issue #3 Plan stage investigation for issue #3, checked on 2026-06-17 11:13 +08:00. Requirement confirmed:
Code and impact scope:
Implementation plan for the implementation stage:
Verification plan:
Current local observation:
|
|
Execution stage update for Workmonitor issue-flow plan stage 20260617-111303 issue #3. Actual changes:
Verification:
E2E/browser note:
Remaining risk:
|
|
Workmonitor issue-flow plan stage 20260617-133039 issue #3 Plan stage investigation checked on 2026-06-17 13:33 +08:00. This stage only investigated and planned; it did not modify code. Requirement confirmed:
Code and impact scope:
Implementation plan for the next stage:
Verification plan:
Notes for verification:
|
|
Execution stage update for Workmonitor issue-flow plan stage 20260617-133039 issue #3. Actual changes:
Verification:
E2E/browser note:
Remaining risk:
|
|
Workmonitor issue-flow plan stage 20260617-143223 issue #3 Plan stage investigation checked on 2026-06-17 14:32 Asia/Shanghai. This stage only investigated and planned; it did not modify code. Requirement confirmed:
Code and impact scope:
Implementation plan for the next stage:
Verification plan:
Verification note:
|
1 similar comment
|
Workmonitor issue-flow plan stage 20260617-143223 issue #3 Plan stage investigation checked on 2026-06-17 14:32 Asia/Shanghai. This stage only investigated and planned; it did not modify code. Requirement confirmed:
Code and impact scope:
Implementation plan for the next stage:
Verification plan:
Verification note:
|
|
Workmonitor issue-flow plan stage 20260617-214833 issue #3 Plan stage investigation checked on 2026-06-17 22:08 Asia/Shanghai. This stage only investigated and planned; it did not modify code. Requirement confirmed:
Code and impact scope:
Implementation plan for the next stage:
Verification plan:
Verification note:
|
|
Test supplement for Workmonitor issue-flow plan stage 20260617-214833 issue #3. What was validated:
Commands and results:
Browser/API e2e note:
Remaining risk:
Issue state unchanged; not closing this stage. |
|
Final summary for Workmonitor issue-flow plan stage 20260617-214833 issue #3. Coverage confirmed:
Final implementation:
Verification results:
E2E status:
Residual risk:
Status:
|
- kimy wrapper: move hash writes after smoke test (MoonshotAI#1) - kimy wrapper: add public/ to web hash inputs (MoonshotAI#3) - kimy wrapper: widen vis hash to include config files (MoonshotAI#4) - kimy wrapper: move lockfile from /tmp to ~/.kimy/bin (MoonshotAI#5) - kimy wrapper: use explicit package list for native hash (MoonshotAI#7) - 01-bundle.mjs: skip vis-asset build when already done (MoonshotAI#2) - justfile: sync deploy with new wrapper, add deploy-full (MoonshotAI#9,MoonshotAI#10,MoonshotAI#11) - flake.nix: add unpin guidance to nixpkgs comment (MoonshotAI#12)
- add `_serviceBrand` to 17 DI service interfaces and 18 implementations that were missing it (red line #3) - restore bare tool-result slice retention in normalizeToolExchanges (lost in the context-projection rewrite) - make BackgroundTaskPersistence.listTasks skip corrupt task files - add optional dirMode to FileStorageService so background task dirs can be 0700 - fix migrated tests: register IBlobStorage, use the 4-arg BackgroundTaskPersistence construction, add the approval stub and kaos/execute-tool fixtures
#2: Batch appendLoopEvent in executeStepTools — collect all tool.call and tool.result events during for-await, then dispatch once at end. Eliminates N synchronous context array copies per step. #3: Wire tryNativeReadBatch into native-tools.ts — existing Rust nativeBatchRead now callable from the tool layer. Callers fall back to sequential nativeRead when native module unavailable. #1: Async-ify native_edit with spawn_blocking — no longer blocks event loop during parallel tool execution.
…, diff drawer, more rounded corners Five user-reported issues fixed in this batch: MoonshotAI#3 Font-size adjustment now actually works Root cause: App.svelte's :global(body) used the `font:` shorthand with a hardcoded 13px, which won over the global.css `body { font-size: var(--ui-font-size) }` rule (same specificity, later in cascade). The shorthand resets font-size and the slider had no effect. Fix: replace shorthand with individual properties (font-family/size/line-height), keep font-size: var(--ui-font-size). Verified via headless Chromium: default 14px, slider to 20px → 20px, back to 14px → 14px. MoonshotAI#8 Plugin enable/disable ACL error Root cause: PluginPanel called Command.sidecar('kimi', ['plugin', 'disable', id]) which needs shell:allow-execute permission that isn't (and shouldn't be) granted in tauri.conf.json. Fix: added Rust `toggle_plugin(plugin_id, enabled)` command that directly edits ~/.kimi-code/plugins/installed.json (atomic tmp+rename). PluginPanel now invoke()s the new command instead of spawning a sidecar. No ACL needed. MoonshotAI#11 Softer UI — bumped radius tokens --r-sm 6→8, --r-md 8→10, --r-lg 10→14, --r-xl 12→18. Legacy scale bumped in parallel (--radius-xs 6→8, etc.). All components using these tokens get the bump automatically. MoonshotAI#2 Sidebar workspace/session hierarchy Workspace headers are now visually bigger (30px tall, 12.5px bold, with a top border + subtle bg gradient) and the session rows are indented (margin-left: 20px, smaller 11.5px font-weight 400). Workspace count badge becomes a pill instead of plain text. The hierarchy reads cleanly now. MoonshotAI#1 Working-directory diff → second-level right drawer New DiffDrawer.svelte component (540px, slides in from right with spring animation). Clicking a file in the '工作区改动' section of RightPanel opens the drawer; inline expansion is gone. Commit- history diffs stay inline (only the working-directory section was changed per UX request). Esc / ✕ / mask click closes. MoonshotAI#9 Composer compact moved into the main control row '压缩' is now a pill button next to mode/model/thinking instead of a separate FAB below. Per UX request: 'mode / model / thinking / compact all in one row'. Verified: svelte-check 0 errors, cargo check 0 warnings.
Summary
Test plan
🤖 Generated with Claude Code